import { Shape } from '@antv/x6';

export function createCircle(graph, options) {
  var ports = {
    groups: {
      group1: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
          styles:{
          
          }
        },
        position: 'top',
      },
      group2: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'right',
      },
      group3: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'bottom',
      },
      group4: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'left',
      },
      
    },
    items: [{
      id: 'port1',
      group: 'group1',
      
    }, {
      id: 'port2',
      group: 'group2',
    }, {
      id: 'port3',
      group: 'group3',
    }, {
      id: 'port4',
      group: 'group4',
    }],
  };
  
  let data = {
    ...options.data,
    bpmnType: options.data && options.data.bpmnType,
  };
  var ccc = new Shape.Circle({
    ports,
    id: options && options.id,
    x: 0,
    y: 0,
    width: 50,
    height: 50,
    label: options.label,
    data: data,
  });
  
  /*如果是 end 节点 加入 border 4*/
  if(data.bpmnType==='结束'){
    ccc.attrs.circle.strokeWidth=4
  }
  
  return ccc;
}
